sap.ui.define([
    "sap/m/MessageToast",
    "sap/ui/core/mvc/Controller",
    "sap/ui/Device",
    "sap/base/Log"
],
    /**
     * @param {typeof sap.ui.core.mvc.Controller} Controller
     */
    function (MessageToast, Controller, Device, Log) {
        "use strict";

        return Controller.extend("c070.controller.Main", {
            onInit: function () {
                this.oSplitApp = this.byId("SplitAppDemo");
            },


            onPressNavToDetail: function () {
                this.oSplitApp.to(this.createId("detailDetail"));
            },

            onPressDetailBack: function () {
                this.oSplitApp.backDetail();
            },

            onPressMasterBack: function () {
                this.oSplitApp.backMaster();
            },

            onPressGoToMaster: function () {
                this.oSplitApp.toMaster(this.createId("master2"));
            },

            onListItemPress: function (oEvent) {
                var sToPageId = oEvent.getParameter("listItem").getCustomData()[0].getValue();

                this.oSplitApp.toDetail(this.createId(sToPageId));
            }

        });
    });
